# -*- codeing = utf-8 -*-
# @Time : 2021/3/4 17:18
# @Atuthor: 朱朱
# @File: 175正则练习3.py
# @Software: PyCharm
import re

z= []
try:
    with open('demo.txt','r',encoding='utf8') as file:
        # content = file.read()
        # re1 = re.findall(r'^1000phone.*',content)
        # re2 = re.findall(r'1000phone.*', content,re.M)

        # 将匹配到的数据写入到列表中
        while True:
            content = file.readline().strip('\n')
            if not content:
                break
            if re.findall(r'^1000phone.*',content):
                z.append(content)

except FileNotFoundError:
    print('打开文件失败')

# print(re1)
print(z)